#!/bin/bash

set -Eeuo pipefail

cd $(dirname $(readlink -f $0))

#IMAGE=ros-humble-base-desktop:latest
IMAGE=ros-humble-classic-all-desktop:latest
CONT=ros-test

set +e
IS_RUN=$(docker container ls -a | grep $CONT)
set -e

if [ -n "$IS_RUN" ]; then
	./ros-desktop.sh \
		--ros-dist humble \
		--image $IMAGE \
		--name $CONT restart
else
	./ros-desktop.sh \
		--ros-dist humble \
		--image $IMAGE \
		--name $CONT \
		--ssh-port 10022 \
		--grpc-port 50052 \
		-- -p 8003:8003 -p 8004:8004 -v $PWD:/root/workspace
fi

